<table class="table table-bordered">
  <tr>
    <td style="text-align:center; background-color:#ab1b1c; border:1px solid #ab1b1c;" colspan="2"><img src="https://www.fraudlabspro.com/images/logo_200.png" alt="FraudLabs Pro"/></td>
  </tr>
  <tr>
    <td>{{ text_transaction_id }}
      <br/>
      <small class="form-text text-muted">{{ help_transaction_id }}</small>
    </td>
    <td><a href="https://www.fraudlabspro.com/merchant/transaction-details/{{ flp_id }}/" target="_blank">{{ flp_id }}</a></td>
  </tr>
  <tr>
    <td>{{ text_score }}
      <br/>
      <small class="form-text text-muted">{{ help_score }}</small>
    </td>
    <td><img src="//fraudlabspro.hexa-soft.com/images/fraudscore/fraudlabsproscore{{ flp_score }}.png" alt="" class="img-fluid"/></td>
  </tr>
  <tr>
    <td>{{ text_status }}
      <br/>
      <small class="form-text text-muted">{{ help_status }}</small>
    </td>
    <td id="flp_status"><span style="font-weight:bold; color: {% if flp_status|lower == 'approve' %} #5cb85c {% elseif flp_status|lower == 'review' %} #f0ad4e {% else %} #d9534f {% endif %};">{{ flp_status }}</span></td>
  </tr>
  <tr>
    <td>{{ text_ip_address }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_address }}</small>
    </td>
    <td>{{ flp_ip_address }}</td>
  </tr>
  <tr>
    <td>{{ text_ip_net_speed }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_net_speed }}</small>
    </td>
    <td>{{ flp_ip_net_speed }}</td>
  </tr>
  <tr>
    <td>{{ text_ip_isp_name }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_isp_name }}</small>
    </td>
    <td>{{ flp_ip_isp_name }}</td>
  </tr>
  <tr>
    <td>>{{ text_ip_usage_type }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_usage_type }}</small>
    </td>
    <td>{{ flp_ip_usage_type }}</td>
  </tr>
  <tr>
    <td>{{ text_ip_domain }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_domain }}</small>
    </td>
    <td>{{ flp_ip_domain }}</td>
  </tr>
  <tr>
    <td>{{ text_ip_time_zone }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_time_zone }}</small>
    </td>
    <td>{{ flp_ip_time_zone }}</td>
  </tr>
  <tr>
    <td>{{ text_ip_location }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_location }}</small>
    </td>
    <td>{{ flp_ip_location }}</td>
  </tr>
  <tr>
    <td>{{ text_ip_distance }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_distance }}</small>
    </td>
    <td>{{ flp_ip_distance }}</td>
  </tr>
  <tr>
    <td>{{ text_ip_latitude }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_latitude }}</small>
    </td>
    <td>{{ flp_ip_latitude }}</td>
  </tr>
  <tr>
    <td>{{ text_ip_longitude }}
      <br/>
      <small class="form-text text-muted">{{ help_ip_longitude }}</small>
    </td>
    <td>{{ flp_ip_longitude }}</td>
  </tr>
  <tr>
    <td>{{ text_risk_country }}
      <br/>
      <small class="form-text text-muted">{{ help_risk_country }}</small>
    </td>
    <td>{{ flp_risk_country }}</td>
  </tr>
  <tr>
    <td>{{ text_free_email }}
      <br/>
      <small class="form-text text-muted">{{ help_free_email }}</small>
    </td>
    <td>{{ flp_free_email }}</td>
  </tr>
  <tr>
    <td>{{ text_ship_forward }}
      <br/>
      <small class="form-text text-muted">{{ help_ship_forward }}</small>
    </td>
    <td>{{ flp_ship_forward }}</td>
  </tr>
  <tr>
    <td>{{ text_using_proxy }}
      <br/>
      <small class="form-text text-muted">{{ help_using_proxy }}</small>
    </td>
    <td>{{ flp_using_proxy }}</td>
  </tr>
  <tr>
    <td>{{ text_bin_found }}
      <br/>
      <small class="form-text text-muted">{{ help_bin_found }}</small>
    </td>
    <td>{{ flp_bin_found }}</td>
  </tr>
  <tr>
    <td>{{ text_email_blacklist }}
      <br/>
      <small class="form-text text-muted">{{ help_email_blacklist }}</small>
    </td>
    <td>{{ flp_email_blacklist }}</td>
  </tr>
  <tr>
    <td>{{ text_credit_card_blacklist }}
      <br/>
      <small class="form-text text-muted">{{ help_credit_card_blacklist }}</small>
    </td>
    <td>{{ flp_credit_card_blacklist }}</td>
  </tr>
  <tr>
    <td>{{ text_credits }}
      <br/>
      <small class="form-text text-muted">{{ help_credits }}</small>
    </td>
    <td>{{ flp_credits }} {{ text_flp_upgrade }}</td>
  </tr>
  <tr>
    <td>{{ text_message }}
      <br/>
      <small class="form-text text-muted">{{ help_message }}</small>
    </td>
    <td>{{ flp_message }}</td>
  </tr>
  {% if flp_status|lower == 'review' %}
    <tr style="background-color: #eee;">
      <td id="flp_action" colspan="2">
        <form id="review-action" method="post">
          <div align="center">
            <button type="button" id="button-flp-approve" class="btn btn-success"><i class="fas fa-check"></i> Approve</button>
            <button type="button" id="button-flp-reject" class="btn btn-danger"><i class="fas fa-times"></i> Reject</button>
            <button type="button" id="button-flp-reject-blacklist" class="btn btn-light" title="Upon clicking the blacklist button, this order will be rejected and the records will be blacklisted."><i class="fas fa-exclamation-circle"></i> Blacklist</button>
          </div>
          <input type="hidden" id="flp_id" name="flp_id" value="{{ flp_id }}"/> <input type="hidden" id="new_status" name="new_status" value=""/> <input type="hidden" id="feedback_note" name="feedback_note" value=""/>
        </form>
      </td>
    </tr>
  {% endif %}
</table>
<div>
  {{ text_flp_merchant_area }}
</div>
<script>
$(document).ready(function() {
	$("#button-flp-approve").click(function() {
		$("#new_status").val("APPROVE");
		$("#review-action").submit();
	});
});

$(document).ready(function() {
	$("#button-flp-reject").click(function() {
		$("#new_status").val("REJECT");
		$("#review-action").submit();
	});
});

$(document).ready(function() {
	$("#button-flp-reject-blacklist").click(function() {
		var note = prompt("Please enter the reason(s) for blacklisting this order. (Optional)");
		if (note !== null) {
			$("#feedback_note").val(note);
			$("#new_status").val("REJECT_BLACKLIST");
			$("#review-action").submit();
		}
	});
});
</script>